import { configure } from 'mobx-miniprogram';

// 业务模块Store
import { plmProjectStore } from './modules/project_store';

// 业务模块Store (为了保持兼容性，同时支持带plm前缀和不带前缀的导入方式)
import { projectStore as moduleProjectStore } from './store_config';

// 配置MobX
configure({
  enforceActions: 'never', // 'never' | 'observed' | 'always'
  computedRequiresReaction: false,
  reactionRequiresObservable: false,
  observableRequiresReaction: false,
  disableErrorBoundaries: false,
});

// 导出所有Store (同时支持带plm前缀和不带前缀的导出)
export {
  plmProjectStore,
  moduleProjectStore as projectStore
};

// 也可以通过getStore函数获取指定Store
export function getStore(name) {
  const stores = {
    'projectStore': moduleProjectStore,
    'plmProjectStore': plmProjectStore
    // 添加其他Store
  };
  
  return stores[name];
}